const Store = require('electron-store')
const store = new Store()

let userId = null
const setUserId = (id) => {
  userId = id
}
const getUserId = () => {
  return userId
}

const setData = (key, value) => {
  store.set(key, value)
}
const getData = (key) => {
  return store.get(key)
}
const setExpressPort = (port) => {
  store.set('expressPort', port)
}
const getExpressPort = () => {
  return store.get('expressPort')
}

export default {
  setUserId,
  getUserId,
  setData,
  getData,
  setExpressPort,
  getExpressPort
}
